package com.mall.seckill_mall.enums;

public enum CodeMessage {
    SUCCESS(10001, "OK"), SERVER_ERROR(10002, "服务端错误"), INVALID_REQUEST(10003, "非法请求")
        , BIND_ERROR(10003, "参数绑定错误"), DB_OP_EERROR(10004, "数据库操作失败"), REDIS_CON_ERROR(10005, "Redis连接失败，请稍后重试")
        , USER_EXISTS(20001, "用户已存在"), USER_PASSWORD_ERROR(20002, "密码错误")
        , USER_NOT_EXISTS(20003, "用户不存在"), REPEAT_LOGIN(20004, "当前已有用户在线")
        , PLEASE_LOGIN(20005, "请先登录"), BALANCE_NOT_ENOUGH(20006, "余额不足")
        , EMPTY_GOODS(30001, "没有商品"), GOODS_NOT_EXISTS(30002, "商品不存在")
        , STOCK_OVER(30003, "库存不足")
        , ORDER_NOT_EXISTS(50001, "订单不存在"), ORDER_TIMEOUT(50002, "订单超时，请重新下单")
        , INVALID_PATH(40001, "路径无效请刷新"), REPEAT_SECKILL(40002, "重复秒杀")
        , NOT_AT_SECKILL_TIME(40003, "秒杀未开始"), IS_SECKILLING(40004, "秒杀进行中")
        , SECKILL_OUT_OF_DATE(40005, "秒杀已结束"), LIMIT_REQUEST(40006, "操作频繁，歇5秒再来试试吧");

    int code;
    String message;

    CodeMessage(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }
}
